home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / w00w00 / sectools / fragrouter / Libnet-0.99b / include / libnet.h < prev   
Encoding:
C/C++ Source or Header  |  1999-07-26  |  3.2 KB  |  118 lines

  1. /*
  2.  *  $Id: libnet.h,v 1.1.1.1 1999/05/18 15:33:41 dugsong Exp $
  3.  *
  4.  *  libnet.h - Network routine library header file
  5.  *
  6.  *  Copyright (c) 1998, 1999 Mike D. Schiffman <mike@infonexus.com>
  7.  *                           route|daemon9 <route@infonexus.com>
  8.  *  All rights reserved.
  9.  *
  10.  * Redistribution and use in source and binary forms, with or without
  11.  * modification, are permitted provided that the following conditions
  12.  * are met:
  13.  * 1. Redistributions of source code must retain the above copyright
  14.  *    notice, this list of conditions and the following disclaimer.
  15.  * 2. Redistributions in binary form must reproduce the above copyright
  16.  *    notice, this list of conditions and the following disclaimer in the
  17.  *    documentation and/or other materials provided with the distribution.
  18.  *
  19.  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  20.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  21.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  22.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  23.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  24.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  25.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  26.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  27.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  28.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  29.  * SUCH DAMAGE.
  30.  *
  31.  */
  32.  
  33. #ifndef __LIBNET_H
  34. #define __LIBNET_H
  35.  
  36. #if (__linux__)
  37. #ifndef _BSD_SOURCE
  38. #define _BSD_SOURCE
  39. #endif
  40. #ifndef __BSD_SOURCE
  41. #define __BSD_SOURCE
  42. #endif
  43. #ifndef _FAVOR_BSD
  44. #define _FAVOR_BSD
  45. #endif
  46. #endif  /* __linux */
  47. #include <stdio.h>
  48. #include <string.h>
  49. #include <unistd.h>
  50. #include <fcntl.h>
  51. #include <signal.h>
  52. #include <stdlib.h>
  53. #include <sys/ioctl.h>
  54. #if defined(HAVE_SYS_SOCKIO_H) && !defined(SIOCGIFADDR)
  55. #include <sys/sockio.h>
  56. #endif
  57. #include <sys/stat.h>
  58. #include <sys/types.h>
  59. #include <ctype.h>
  60. #include <sys/socket.h>
  61. #include <netinet/in.h>
  62. #include <netinet/in_systm.h>
  63. #include <netinet/ip.h>
  64. #include <net/if.h>
  65. #if !(__linux__)
  66. #include <netinet/ip_var.h>
  67. #else   /* __linux__ */
  68. #if (HAVE_NET_ETHERNET_H)
  69. #include <net/ethernet.h>
  70. #endif  /* HAVE_NET_ETHERNET_H */
  71. #endif  /* __linux__ */
  72. #include <netinet/tcp.h>
  73. #include <netinet/udp.h>
  74. #include <netinet/ip_icmp.h>
  75. #if (__linux__) && !(__GLIBC__)
  76. /*
  77.  *  We get multiple definitions of IGMP_AGE_THRESHOLD if we include netinet.
  78.  */
  79. #include <linux/igmp.h>
  80. #else
  81. #include <netinet/igmp.h>
  82. #endif
  83. #include <arpa/inet.h>
  84. #include <sys/time.h>
  85. #include <netdb.h>
  86. #include <errno.h>
  87. #include <assert.h>
  88.  
  89. #include "./libnet/libnet-headers.h"
  90. #include "./libnet/libnet-structures.h"
  91. #include "./libnet/libnet-macros.h"
  92. #include "./libnet/libnet-asn1.h"
  93. #include "./libnet/libnet-functions.h"
  94.  
  95. #define LIBNET_VERSION  "0.99b"
  96.  
  97.  
  98. /*
  99.  *  Linux specific issues.
  100.  */
  101. #if (__linux__)
  102. #if (__GLIBC__ != 2)
  103. #define uh_sport source 
  104. #define uh_dport dest
  105. #define uh_ulen  len
  106. #define uh_sum   check
  107. #if (HAVE_STRUCT_IP_CSUM)
  108. #define ip_sum ip_csum
  109. #endif
  110. #endif
  111. #define IP_MAXPACKET 65535
  112. #endif
  113.  
  114.  
  115. #endif  /* __LIBNET_H */
  116.  
  117. /* EOF */
  118.